{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "# 使用%matplotlib命令可以将matplotlib的图表直接嵌入到Notebook之中\n",
    "%matplotlib inline\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x15be0a4f0>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGdCAYAAACyzRGfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAk5klEQVR4nO3dfXhU9YH28fvMJDOJMRkISiBLotFiUUCqRqzEp5XCwlIefKtSLSpit91tQyFSXaDdqF3BiG2ti1IQu0X6VKBeLUGl1RYjQqm8x1hs5U0RUlmgrjATEhiSOb/nDyRrIK8w8zuT8P1c17lkzvllzu3JMOfmnDNnHGOMEQAAgCU+rwMAAICzC+UDAABYRfkAAABWUT4AAIBVlA8AAGAV5QMAAFhF+QAAAFZRPgAAgFUpXgc4meu62rt3rzIzM+U4jtdxAABAOxhjVFNTo9zcXPl8rR/bSLrysXfvXuXl5XkdAwAAnIbq6mr16dOn1TFJVz4yMzMlHQ+flZXlcRoAANAekUhEeXl5jfvx1iRd+ThxqiUrK4vyAQBAJ9OeSya44BQAAFhF+QAAAFZRPgAAgFWUDwAAYBXlAwAAWEX5AAAAVlE+AACAVZQPAABgVdLdZAzeM7F90rFNklwp9XNyUvK9jgQA6EI6fORj9erVGjNmjHJzc+U4jpYtW9a4rL6+XlOnTtXAgQOVkZGh3Nxc3X333dq7d288MyNBjHtY7qH7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/tct5558nv92v//v1N5u/fv1+9evXyKFXymzhxopYvX66VK1eqT58+XsdJSps3b9aBAwd05ZVXKiUlRSkpKVq1apVmz56tlJQUxWIxryMmjd69e+uyyy5rMu/SSy/Vnj17PEqUvB544AFNmzZNt99+uwYOHKi77rpL9913n8rKyryOltROvJ/zXt8xJ4rH7t27tWLFCitHPaSzoHwEAgFdddVVqqioaJznuq4qKip07bXXepgsORljNHHiRJWXl+v1119XQUGB15GS1rBhw7RlyxZVVVU1ToWFhRo3bpyqqqrk9/u9jpg0ioqKTvnI9vbt23XBBRd4lCh51dXVyedr+tbs9/vluq5HiTqHgoIC9erVq8l7fSQS0fr163mvb8GJ4rFjxw699tpr6tGjh7V1nxWnXaZMmaLx48ersLBQgwcP1pNPPqna2lpNmDDB62hJp7i4WIsWLdKLL76ozMzMxnOloVBI6enpHqdLLpmZmadcC5ORkaEePXpwjcxJ7rvvPg0ZMkSPPvqoxo4dqw0bNmj+/PmaP3++19GSzpgxYzRz5kzl5+erf//+euutt/TEE0/o3nvv9Tqa5w4fPqydO3c2Pt61a5eqqqqUnZ2t/Px8lZSUaMaMGerbt68KCgpUWlqq3Nxc3XTTTd6F9lBr26t379669dZbVVlZqeXLlysWizW+32dnZysQCCQ2XMI/T5MknnrqKZOfn28CgYAZPHiwWbdundeRkpKkZqcFCxZ4Ha1T4KO2LXv55ZfNgAEDTDAYNP369TPz58/3OlJSikQiZvLkySY/P9+kpaWZiy66yHz/+9830WjU62ieW7lyZbPvT+PHjzfGHP+4bWlpqcnJyTHBYNAMGzbMbNu2zdvQHmpte+3atavF9/uVK1cmPJtjDLfNAwAA9nT5az4AAEByoXwAAACrKB8AAMAqygcAALCK8gEAAKyifAAAAKsoHwAAwCrKBwAAsIryAQAArKJ8AAAAqygfAADAKsoHAACw6v8DoER4xkuzPLgAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = pd.read_excel('../data/电影类型.xlsx')\n",
    "x = data[['打斗镜头', '亲吻镜头']]\n",
    "y = data['类型'].map({'动作': 0, '爱情': 1})\n",
    "plt.scatter(x['打斗镜头'], x['亲吻镜头'], c=y)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAekAAABlCAYAAABpyxuAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAA9hAAAPYQGoP6dpAAADSElEQVR4nO3aQW4bdRjG4c9uWheQbSkrZNmrCLHnDpyELQdgl3uwReqSYyDuUCmLjGR1nSkQmTTDoiobcFv/lWreaZ5nO57Rp8+Wfxp7ZsMwDAUAxJmPPQAA8P9EGgBCiTQAhBJpAAgl0gAQSqQBIJRIA0Cos9YT7+/va7/f13K5rNls9pAzAcBnbRiG6vu+NptNzefH75ebI73f72u327WeDgCPXtd1td1ujx5vjvRyuayqqpc//FTLZ89bL/Po/P7Nr2OPMEk/fz32BNPz6u7HsUeYpKe33489wuT88tti7BEm5/Whr+9efPtvS49pjvS7n7iXz57XaiHSH+urL56MPcIkPf1y7Amm58mdpbU4m73/S5P/cqPW7kN/F3twDABCiTQAhBJpAAgl0gAQSqQBIJRIA0AokQaAUCINAKFEGgBCiTQAhBJpAAgl0gAQSqQBIJRIA0AokQaAUCINAKFEGgBCiTQAhBJpAAgl0gAQSqQBIJRIA0AokQaAUCINAKFEGgBCiTQAhBJpAAgl0gAQSqQBIJRIA0AokQaAUCINAKFEGgBCiTQAhBJpAAgl0gAQSqQBIJRIA0AokQaAUCINAKFEGgBCiTQAhBJpAAgl0gAQSqQBIJRIA0AokQaAUCINAKFEGgBCiTQAhBJpAAgl0gAQSqQBIJRIA0AokQaAUCINAKFEGgBCiTQAhBJpAAgl0gAQSqQBIJRIA0AokQaAUCINAKFEGgBCiTQAhBJpAAgl0gAQSqQBIJRIA0AokQaAUCINAKFEGgBCnbWeOAxDVVX1h9sHG+Yx+OOvN2OPMEl//zn2BNPz5s7SWtzd9mOPMDn94TD2CJPz+vD2c/aupcfMhg+94oirq6u6uLhoORUAqKqu62q73R493nwnfX5+XlVV19fXtV6vWy/zqNzc3NRut6uu62q1Wo09zmTY2+nsrI29nc7O2gzDUH3f12azee/rmiM9n7/9O3u9XntjTrRareysgb2dzs7a2Nvp7Ox0H3OD68ExAAgl0gAQqjnSi8WiLi8va7FYPOQ8nzU7a2Nvp7OzNvZ2Ojv7tJqf7gYAPi0/dwNAKJEGgFAiDQChRBoAQok0AIQSaQAIJdIAEEqkASDUPztsgFSaAzbsAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 600x100 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "colors = sns.color_palette('husl')\n",
    "sns.palplot(colors)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'love')"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAGwCAYAAACzXI8XAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAA9hAAAPYQGoP6dpAAApsklEQVR4nO3de3hU9aHu8XcySSYXkoFEIBlINLUodwURDuAFC4KI3Fqh8ARB7Kln7x2EiFqwLahbJKhb6lZ5UOhp7D41YPeuoam7YpGrKEIghi2KXGwUECEokAkJuc2s84cyNRBiEpKs9Yvfz/PM87AuM/NmJc68/tZvzbgsy7IEAABgoDC7AwAAADQVRQYAABiLIgMAAIxFkQEAAMaiyAAAAGNRZAAAgLE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b1efPn20ZMmS0Cmgn/zkJ7rtttt0yy23qGPHjlq1atVFnys9PV27d+/WjTfeeMGH02ZnZ2v69Ol64IEHdPXVV2vChAnKz89v0Q+xdVltfNjD7/fL6/WqpKTkO694AgB8v1VUVKioqEhpaWmKiopq+uPUnA1dybTq9nda/NSSqeo73g19/3b0VUsAAJgoKjy6RS6xxoU4tQQAAIxFkQEAAMaiyAAAAGNRZAAAgLEoMgAAwFgUGQAAYCyKDAAAMBZFBgAAww0bNkyZmZl2x7AFRQYAABiLIgMAAIxFkQEAoA05deqUpk+frg4dOigmJkajR4/WgQMHJH39/UXR0dF64403at0nNzdXcXFxKi8vlyQdPnxYkydPVvv27ZWQkKDx48fr008/be0fpUEoMgAAtCF33323du7cqby8PG3btk2WZen2229XdXW14uPjdccddygnJ6fWfV555RVNmDBBMTExqq6u1qhRoxQXF6e3335b77zzjtq1a6fbbrtNVVVVNv1UF8eXRgIAcInO1liN2j863NUiOQ4cOKC8vDy98847GjJkiKSvS0pKSorWrFmjSZMmKT09XXfddZfKy8sVExMjv9+v//7v/1Zubq4k6dVXX1UwGNRvf/tbuVxf58zOzlb79u21adMmjRw5skWyNxVFBgCAS3Tr6pON2n/rtMQWybF3716Fh4dr0KBBoXWJiYm6+uqrtXfvXknS7bffroiICOXl5WnKlCn605/+pPj4eI0YMUKStHv3bh08eFBxcXG1HruiokKffPJJi+S+FBQZAAC+RyIjI3XnnXcqJydHU6ZMUU5Ojn76058qPPzrSnDmzBldd911euWVVy64b8eOHVs77neiyAAAcInWTUmwO4IkqUePHqqpqdH27dtDp5a++uor7du3Tz179gztl56erltvvVUffvihNmzYoEWLFoW29e/fX6+++qo6deqk+Pj4Vv8ZGovJvgAAXKLocFejbi2lW7duGj9+vH7+859r69at2r17t6ZNm6YuXbpo/Pjxof1uuukmJSUlKT09XWlpabVORaWnp+uyyy7T+PHj9fbbb6uoqEibNm3S7NmzdeTIkRbL3lQUGQAA2pDs7Gxdd911uuOOOzR48GBZlqW//vWvioiICO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6HEZlGqqqq0q5duzRixIjQurCwMI0YMULbtm2zMZnzlZSUSJISEhJsTuJcGRkZGjNmTK2/L9SWl5enAQMGaNKkSerUqZP69eunlStX2h3LsYYMGaL169dr//79kqTdu3dr69atGj16tM3JnK2oqEjHjh2r9d+i1+vVoEGDeK1vgJKSErlcLrVv377Fn6vNf2lkc/vyyy8VCATUuXPnWus7d+6sjz/+2KZUzhcMBpWZmamhQ4eqd+/edsdxpNWrV6ugoED5+fl2R3G0v//971q+fLnmzp2rX/7yl8rPz9fs2bMVGRmpGTNm2B3PcebPny+/36/u3bvL7XYrEAjoiSeeUHp6ut3RHO3YsWOSVOdr/bltqFtFRYXmzZunqVOntsqXblJk0CoyMjK0Z88ebd261e4ojnT48GHNmTNH69atU1RUlN1xHC0YDGrAgAFavHixJKlfv37as2ePXnzxRYpMHf74xz/qlVdeUU5Ojnr16qXCwkJlZmbK5/NxvNDsqqurNXnyZFmWpeXLl7fKc3JqqZEuu+wyud1uHT9+vNb648ePKykpyaZUzjZr1iy9/vrr2rhxo7p27Wp3HEfatWuXiouL1b9/f4WHhys8PFybN2/Wc889p/DwcAUCAbsjOkZycrJ69uxZa12PHj106NAhmxI520MPPaT58+drypQp6tOnj+666y7df//9ysrKsjuao517Pee1vuHOlZjPPvtM69ata5XRGIki02iRkZG67rrrtH79+tC6YDCo9evXa/DgwTYmcx7LsjRr1izl5uZqw4YNSktLszuSYw0fPlwffPCBCgsLQ7cBAwYoPT1dhYWFcrvddkd0jKFDh15wGf/+/ft1+eWX25TI2crLyxUWVvul3u12KxgM2pTIDGlpaUpKSqr1Wu/3+7V9+3Ze6+twrsQcOHBAb731lhITE1vtuTm11ARz587VjBkzNGDAAA0cOFDPPvusysrKNHPmTLujOUpGRoZycnL05z//WXFxcaHzyl6vV9HR0Tanc5a4uLgL5g7FxsYqMTGROUXnuf/++zVkyBAtXrxYkydP1o4dO7RixQqtWLHC7miONHbsWD3xxBNKTU1Vr1699P7772vp0qW655577I5muzNnzujgwYOh5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vJEmflR5U0AooY/2EWverDlZf0vMCaH0UGQCtbvGOTHWMTtK/XPNrdYjqKMuyNGfTJNUEqxUZ5mmW57ip62j9ds/T+nmfX2jL52/o8rgf6vL4bpKkippyhbnc+rebX1HYeZ9CERUe0yzPD6B18DkyAFqVv+q0Pj/zqSZd9b/Vt+MgpcT9QGeq/aHtl8d306cl+1VaVVLn/cPDIhT8ZgSnPgOThqk6UKn3i9/V25+v1U1dbw9tS/N2V9AKqKTypJLbpda6cfUTYBaKDIBW1S4iXnGR7fW3z17TF2cO6X9O7FD2h0tD22/sepvaexK1ZMdc7f2qUMfKjmjb0fX6+ORuSVKnGJ+Kyz9XUck++StPqTpQVefzRIVHa2DSMOV8vFxHSot0Y5dRoW1d2l2um7qM1r+/v1Dbjq7X8bLPtf/UHv3pwO+08/jbLXsAADQrigyAVhXmCtMD12Xpk9N7NWfTZGV/+Ixm9MwMbY8Ii9Ajg5fJ60nQou2zlblpsl47mK0wl1uSNDh5uPp1GqIF796rGW8O19ufr73oc93U9XZ96t+vHon91DEmuda2+/o9qmFdx+jlj36jWRsmasmOuTpw6kN1jE5qkZ8bQMvgc2QAAICxGJEBAADGosgAAABjUWQAAICxKDIAAMBYFBkAAGAsigwAADAWRQYAABiLIgMAAIxFkQEAAMaiyAAAAGNRZAAAgLH+PzDI6EFV28DMAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "active = x.loc[y == 0]\n",
    "love = x.loc[y == 1]\n",
    "plt.scatter(active['打斗镜头'], active['亲吻镜头'], marker='+',\n",
    "            s=80, color=colors[2], label='active')\n",
    "plt.scatter(love['打斗镜头'], love['亲吻镜头'], marker='_',\n",
    "            s=80, color=colors[4], label='love')\n",
    "plt.legend()\n",
    "plt.xlabel('active', color=colors[2])\n",
    "plt.ylabel('love', color=colors[4])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.neighbors import KNeighborsClassifier\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# n_neighbors是K值的个数,分类问题一般取奇数\n",
    "knn = KNeighborsClassifier(n_neighbors=3)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-1 {color: black;background-color: white;}#sk-container-id-1 pre{padding: 0;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>KNeighborsClassifier(n_neighbors=3)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" checked><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">KNeighborsClassifier</label><div class=\"sk-toggleable__content\"><pre>KNeighborsClassifier(n_neighbors=3)</pre></div></div></div></div></div>"
      ],
      "text/plain": [
       "KNeighborsClassifier(n_neighbors=3)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 使用数据样本训练knn\n",
    "knn.fit(x, y)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/dellu/miniconda3/envs/d2l/lib/python3.8/site-packages/sklearn/base.py:450: UserWarning: X does not have valid feature names, but KNeighborsClassifier was fitted with feature names\n",
      "  warnings.warn(\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([0, 0, 1])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 训练之后就变成了模型对象,模型对象可以用来预测未知数据\n",
    "film = np.array([[7, 3], [10, 3], [1, 9]])\n",
    "knn.predict(film)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/dellu/miniconda3/envs/d2l/lib/python3.8/site-packages/sklearn/base.py:450: UserWarning: X does not have valid feature names, but KNeighborsClassifier was fitted with feature names\n",
      "  warnings.warn(\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x15cfdf640>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAGwCAYAAACzXI8XAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAs60lEQVR4nO3de3RU9aH28WcyuYdkIBFIAgmmFkVuCiK8gCIWBAG5eUFYQRB7antOECLWgq2gHpGgHqn18qLgaWzfCtjTCkaPoohcRBACMVQUudjIVQgKZELumdnvH8jUQBJynT2/+P2sNWu5LzPzZAdnnvz2b884LMuyBAAAYKAguwMAAAA0FEUGAAAYiyIDAACMRZEBAADGosgAAABjUWQAAICxKDIAAMBYwXYHaG5er1dHjx5VdHS0HA6H3XEAAEAdWJalwsJCJSYmKiio5nGXFl9kjh49qqSkJLtjAACABjh06JA6duxY4/YWX2Sio6MlnT0QMTExNqcBAAB14Xa7lZSU5Hsfr0mLLzLnTifFxMRQZAAAMMzFpoUw2RcAABiLIgMAAIxFkQEAAMZq8XNkAACoL6/Xq/LycrtjtGghISFyOp2NfhyKDAAAP1BeXq68vDx5vV67o7R4rVu3Vnx8fKM+540iAwDA9yzL0jfffCOn06mkpKRaP4gNDWdZloqLi5Wfny9JSkhIaPBjUWQAAPheZWWliouLlZiYqMjISLvjtGgRERGSpPz8fLVr167Bp5momgAAfM/j8UiSQkNDbU7y43CuLFZUVDT4MSgyAACch+/m84+mOM4UGQAAYCxbi8zGjRs1evRoJSYmyuFwaNWqVb5tFRUVmj17tnr06KGoqCglJiZqypQpOnr0qH2BAQBAQLG1yBQVFemqq67Siy++eMG24uJi5eTkaO7cucrJydEbb7yhPXv2aMyYMTYkBQCg7korSzQ+q7fGZ/VWaWWJ3XEa7PxBhkBk61VLI0aM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XrptzcXKWnpysxMZHjhSZXUVGhCRMmyLIsLV682C/PyamlerrkkkvkdDp1/PjxKuuPHz+u+Ph4m1IFtunTp+vtt9/WunXr1LFjR7vjBKQdO3YoPz9fvXv3VnBwsIKDg7VhwwY999xzCg4OlsfjsTtiwEhISFDXrl2rrLvyyit18OBBmxIFtgcffFBz5szRxIkT1aNHD9111126//77lZGRYXe0gHbu9ZzX+ro7V2IOHDigNWvW+GU0RqLI1FtoaKiuueYarV271rfO6/Vq7dq16t+/v43JAo9lWZo+fbpWrlypDz/8UCkpKXZHClhDhgzRZ599ptzcXN+tT58+Sk1NVW5urpxOp90RA8bAgQMvuIx/79696tSpk02JAltxcbGCgqq+1DudTnm9XpsSmSElJUXx8fFVXuvdbre2bt3Ka301zpWYffv26YMPPlBcXJzfnptTSw0wa9YsTZ06VX369FHfvn317LPPqqioSNOmTbM7WkBJS0vTsmXL9Oabbyo6Otp3XtnlcikiIsLmdIElOjr6grlDUVFRiouLY07Ree6//34NGDBACxYs0IQJE7Rt2zYtWbJES5YssTtaQBo9erSeeOIJJScnq1u3bvr000+1aNEi3XPPPXZHs92ZM2e0f/9+33JeXp5yc3MVGxur5ORkpaena/78+ercubNSUlI0d+5cJSYmaty4cfaFtkltxyohIUG33367cnJy9Pbbb8vj8fhe72NjYxUaGtq84Zr9uqgW6vnnn7eSk5Ot0NBQq2/fvtYnn3xid6SAI6naW2Zmpt3RjMDl1zV76623rO7du1thYWFWly5drCVLltgdKWC53W5r5syZVnJyshUeHm795Cc/sX73u99ZZWVldkez3bp166p9jZo6daplWWcvwZ47d67Vvn17KywszBoyZIi1Z88ee0PbpLZjlZeXV+Pr/bp165o9m8Oy+HhHAABgJubIAAAAY1FkAACAsSgyAADAWBQZAABgLIoMAAAwFkUGAAAYiyIDAACMRZEBAADGosgAaBHGZ/XW1m/W2R0DgJ/xyb4AjLLiy5e09dh6/X7wiirrT5V+q1YhMQpxNvP3ugAIKHxpJIAWoU34JXZHAGADRmQA+F1O/sf6n73/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/KFRar+VtnKH39BL2xP1NBDqckqX/CEPVqN0BzN9+rqe8N0UdHVtf4XIM6jtTX7r26Mq6X2kYmVNl2X69HNbjjKL36xe81/cPxWrhtlvad+lxtI+Kb5ecG0Dz4HBkAAGAsRmQAAICxKDIAAMBYFBkAAGAsigwAADAWRQYAABiLIgMAAIxFkQEAAMaiyAAAAGNRZAAAgLEoMgAAwFgUGQAAYKz/D0hD7fCewMpeAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "active = x.loc[y == 0]\n",
    "love = x.loc[y == 1]\n",
    "plt.scatter(active['打斗镜头'], active['亲吻镜头'], marker='+',\n",
    "            s=80, color=colors[2], label='active')\n",
    "plt.scatter(love['打斗镜头'], love['亲吻镜头'], marker='_',\n",
    "            s=80, color=colors[4], label='love')\n",
    "plt.legend()\n",
    "plt.xlabel('active', color=colors[2])\n",
    "plt.ylabel('love', color=colors[4])\n",
    "# 绘制预测的散点\n",
    "plt.scatter(film[:, 0], film[:, 1], c=knn.predict(film))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/dellu/miniconda3/envs/d2l/lib/python3.8/site-packages/sklearn/base.py:450: UserWarning: X does not have valid feature names, but KNeighborsClassifier was fitted with feature names\n",
      "  warnings.warn(\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([0, 0, 1])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# K值的选择经验值: 不能超过样本集数据个数的平方根,并且K选择奇数\n",
    "knn = KNeighborsClassifier(n_neighbors=5)\n",
    "knn.fit(x, y)\n",
    "film = np.array([[7, 3], [10, 3], [1, 9]])\n",
    "knn.predict(film)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 如何找到合适的K值?\n",
    "* 对模型优化,需要掌握对模型评价的策略\n",
    "* 要知道那个K值对应的模型的预测效果更好(需要使用评价指标来完成)\n",
    "* 分类模型最常用的就是准确率(预测正确的样本个数 / 预测的总样本数)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.13 ('d2l')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.13"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "6bdcd3dff61cfecb093f68bfbd67338d4a9739a04d65268bf3b66287b86a0a9e"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
